/*
============================================================================
 Name        : C$(Basename)Container from $(Basename)Container.h
 Author      : $(Author)
 Version     :
 Copyright   : $(Copyright)
 Description : Container control implementation
============================================================================
*/

// INCLUDE FILES
#include "$(Basename)Container.h"
#include "$(Basename).mbg"

#include <aknutils.h>
#include <akniconutils.h>

// ================= MEMBER FUNCTIONS =======================

// ---------------------------------------------------------
// C$(Basename)Container::ConstructL(const TRect& aRect)
// EPOC two phased constructor
// ---------------------------------------------------------
//
void C$(Basename)Container::ConstructL(const TRect& aRect)
	{
	CreateWindowL();

	_LIT(KIconBasename, "$(Basename).mif");
	TFileName file(KIconBasename);

	User::LeaveIfError(CompleteWithAppPath(file));
	iSVGIcon = AknIconUtils::CreateIconL(file, 16384);

	SetRect(aRect);
	ActivateL();
	}

// Destructor
C$(Basename)Container::~C$(Basename)Container()
	{
	delete iSVGIcon;
	}

// ---------------------------------------------------------
// C$(Basename)Container::SizeChanged()
// Called by framework when the view size is changed
// ---------------------------------------------------------
//
void C$(Basename)Container::SizeChanged()
	{
	// TODO: Add here control resize code etc.
	AknIconUtils::SetSize(iSVGIcon, Rect().Size());
	}

// ---------------------------------------------------------
// C$(Basename)Container::Draw(const TRect& aRect) const
// ---------------------------------------------------------
//
void C$(Basename)Container::Draw(const TRect& aRect) const
	{
	// TODO: Add your drawing code here
	// example code...
	SystemGc().BitBlt(TPoint(), iSVGIcon);
	}

// ---------------------------------------------------------
// C$(Basename)Container::HandleControlEventL(
//	 CCoeControl* aControl,TCoeEvent aEventType)
// ---------------------------------------------------------
//
void C$(Basename)Container::HandleControlEventL(
	CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
	{
	// TODO: Add your control event handler code here
	}
